package com.ly.controller;

import com.ly.feign.ConsumerFeign;
import com.ly.pojo.Products;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/consumer")
public class ConsumerController {
    @Autowired
    private ConsumerFeign consumerFeign;

    @RequestMapping("/getPort")
    public String getPort() {
        return consumerFeign.getPort();
    }

    @RequestMapping("/getProductsById/{id}")
    public Products getProductsById(@PathVariable("id") Integer id) {
        return consumerFeign.getProductsById(id);
    }


}
